<template>
  <div class="welcome-container">
    <!-- 主标题区域 -->
    <div class="header-section">
      <h1 class="main-title">欢迎使用</h1>
      <h2 class="system-title">
        基于SSM的言㐱陪诊<br>大数据展示系统
      </h2>
    </div>

    <!-- 动态装饰元素 -->
    <div class="decorations">
      <div class="pulse-circle"></div>
      <div class="wave-effect"></div>
    </div>

    <!-- 操作按钮区域 -->
    <div class="action-section">
<!--      <el-button type="primary" size="large" @click="goToLogin">前往登录</el-button>-->
      <van-button
          type="primary"
          round
          size="large"
          class="login-btn"
          @click="navigateToHome"
          style="padding: 20px;border-radius: 25px; /* 调整按钮内边距 */ font-weight: bold; /* 加粗字体 */ font-family: 黑体,serif;
  font-size: 20px; /* 增大按钮字体大小 */cursor: pointer;"
      >
        返回首页
        <template #icon>
          <user-icon class="btn-icon" />
        </template>
      </van-button>
      <van-button
          type="primary"
          round
          size="large"
          class="login-btn"
          @click="navigateToLogin"
          style="padding: 20px;border-radius: 25px; /* 调整按钮内边距 */ font-weight: bold; /* 加粗字体 */ font-family: 黑体,serif;
  font-size: 20px; /* 增大按钮字体大小 */cursor: pointer;"
      >
        立即登录
        <template #icon>
          <user-icon class="btn-icon" />
        </template>
      </van-button>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'
import { showToast } from 'vant'
// 修正图标引入方式
import UserIcon from '@icon-park/vue-next/es/icons/User'

const router = useRouter()

const navigateToLogin = () => {
  router.push('/login')
  showToast({ message: '正在跳转登录...', position: 'bottom' })
}
const navigateToHome = () => {
  router.push('/home2')
  showToast({ message: '正在跳转首页...', position: 'bottom' })
}
</script>

<style scoped>
.welcome-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 2rem;
}

.header-section {
  text-align: center;
  margin-top: 15vh;
  animation: fadeInUp 1s ease;
}

.header-section .main-title {
  font-size: 2.5rem;
  color: #2c3e50;
  margin-bottom: 1rem;
  font-weight: 600;
  letter-spacing: 2px;
}

.header-section .system-title {
  font-size: 1.8rem;
  color: #4a90e2;
  line-height: 1.4;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.login-btn {
  width: 280px;
  height: 50px;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
  transition: all 0.3s ease;
}

.login-btn:active {
  transform: scale(0.95);
}

.login-btn .btn-icon {
  margin-right: 8px;
  font-size: 1.4em;
  vertical-align: middle;
  transform: translateY(-1px);
}

.action-section {
  margin-top: auto;
  margin-bottom: 10vh;
  animation: slideInUp 0.8s ease 0.3s backwards;
}

/* 动态装饰效果 */
.pulse-circle {
  width: 200px;
  height: 200px;
  background: rgba(74, 144, 226, 0.1);
  border-radius: 50%;
  position: absolute;
  top: 30%;
  animation: pulse 2s infinite;
}

.wave-effect {
  width: 300px;
  height: 300px;
  border: 4px solid #4a90e2;
  border-radius: 50%;
  position: absolute;
  top: 20%;
  opacity: 0.1;
  animation: wave 3s infinite;
}

/* 动画定义 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(0.8);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.2;
  }
  100% {
    transform: scale(0.8);
    opacity: 0.6;
  }
}

@keyframes wave {
  0% {
    transform: scale(0.8);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(0.8);
  }
}
</style>